package com.ihelin.insurance.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.HttpSession;

/**
 * @author iHelin
 * @since 2021/2/27 14:18
 */
@Controller
public class AdminPageController {

    @GetMapping("/admin/login")
    public String login() {
        return "admin/login";
    }

    @GetMapping("/admin/index")
    public String index() {
        return "admin/index";
    }

    @GetMapping("/admin/agents")
    public String agents() {
        return "admin/agents";
    }

    @GetMapping("/admin/customers")
    public String customers() {
        return "admin/customers";
    }

    @GetMapping("/admin/performance")
    public String performance() {
        return "admin/performance";
    }

    @GetMapping("/admin/payment")
    public String payment() {
        return "admin/payment";
    }

    /**
     * 注销
     *
     * @param session
     * @return
     */
    @GetMapping("/admin/logout")
    public String logout(HttpSession session) {
        session.removeAttribute("adminUser");
        return "redirect:/index";
    }

}
